const config = require('./config')
const BufferRingQueue = require('./BufferRingQueue')
const { StargateClient } = require('@cosmjs/stargate')

const rpc = config.rpc.noble[0];

const runAll = async ()=>{
    const client = await StargateClient.connect(rpc);
    let chainID = await client.getChainId();
    console.log("With client, chain id:",  chainID)
  
}
const num = 200
const main= async ()=>{
    //let bufferQueue = new BufferRingQueue(num)
    let oldTime = new Date().getTime();
    console.log("oldTime: ", oldTime);
    for(let i =0; i< num;i++){
        console.log('i ======= ', i)
        await runAll();
    }
    let newTime = new Date().getTime();
    console.log("newTime ", newTime);
    let spendTime = newTime - oldTime;
    
    console.log('spendTime: ', spendTime);
    console.log('spendTime / 1000: ', spendTime/ 1000)
}
main();